home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / lists / mint / l_1199 / 1121 < prev    next >
Encoding:
Internet Message Format  |  1994-08-27  |  2.9 KB

  1. Subject: Re: another 1.10 job control bug?
  2. Date: Thu, 3 Mar 94 19:58:24 CET
  3. From: Juergen Lock <nox@jelal.north.de>
  4. In-Reply-To: <199402282210.RAA17300@terminator.rs.itd.umich.edu>; from "Nicholas S Castellano" at Feb 28, 94 5:10 pm
  5. Message-Id: <9403031858.AA00174@jelal.north.de>
  6.  
  7. Nicholas S Castellano writes:
  8.  
  9. > > After having been on holiday last week I've digged myself through the pile
  10. > >of patches that arose in my mailbox yesterday, namely those of SRU, NOX and
  11. > >AS. I sort of remember there were also some fixes dealing with job control.
  12. > >Something seems to have gone wrong with them, cause now I'm only able to log
  13. > >in once at the console, every following getty gets stopped after some:
  14. > >
  15. > >pid  91 (getty): Fcntl(0, cmd=0x5401)
  16. > >pid  91 (getty): Fcntl mode 5401: calling ioctl
  17. > >pid  91 (getty): job control: tty pgrp is 16 proc pgrp is 91
  18. > >pid  91 (getty): killgroup 91 22
  19. > >
  20. > > This did not happen in the "clean" version of 1.10, and it does not happen
  21. > >on any vconsole (2 Juergen: looks like they're really good 4 something... :-)
  22. > In one of the patches sent out by nox, there was a 'fix' I sent out a
  23. > few weeks ago for a problem someone described in tty.c.  I think the
  24. > 'fix' is actually worse than the problem, and that code should *not*
  25. > be disabled.
  26. > The code in question is to release the controlling tty (by setting
  27. > it's pgrp to 0) when the process group leader attached to that process
  28. > exits.
  29.  
  30.  i think the problem was when there are several processes in a group the
  31. leader isn't always the one that exits last, and then you could no longer
  32. signal the others from the terminal after that. (^c, ^z, ...)  of course
  33. you could say the parent should always catch SIGCHLD and then TIOCSPGRP
  34. whenever the first process in a pipe (for example) exited but somehow i
  35. doubt thats a real solution...  (although i did put such a hack in ksh
  36. first... :)
  37. > Try undoing that patch and see if it helps.
  38.  
  39.  or try this one:
  40.  
  41. Index: dosmem.c
  42. @@ -748,6 +749,7 @@
  43.          }
  44.      }
  45.  
  46. +#if 0
  47.  /* release the controlling terminal, if we're a process group leader */
  48.      fp = curproc->handle[-1];
  49.      if (fp && is_terminal(fp) && curproc->pgrp == curproc->pid) {
  50. @@ -755,6 +757,26 @@
  51.          if (curproc->pgrp == tty->pgrp)
  52.              tty->pgrp = 0;
  53.      }
  54. +#else
  55. +/* release the controlling terminal, if we're the last member of this pgroup */
  56. +    fp = curproc->handle[-1];
  57. +    if (fp && is_terminal(fp)) {
  58. +        struct tty *tty = (struct tty *)fp->devinfo;
  59. +        int pgrp = curproc->pgrp;
  60. +
  61. +        if (pgrp == tty->pgrp) {
  62. +            PROC *p;
  63. +            int found = 0;
  64. +
  65. +            for (p = proclist; p; p = p->gl_next) {
  66. +                if (p->pgrp == pgrp && p->handle[-1] == fp)
  67. +                    found++;
  68. +            }
  69. +            if (!found)
  70. +                tty->pgrp = 0;
  71. +        }
  72. +    }
  73. +#endif
  74.  
  75.  /* close all files */
  76.      for (i = MIN_HANDLE; i < MAX_OPEN; i++) {
  77.  
  78. i hope that finalls does it. :)
  79.  
  80.  cheers
  81.     Juergen
  82. -- 
  83. J"urgen Lock / nox@jelal.north.de / UUCP: ..!uunet!unido!uniol!jelal!nox
  84.                                 ...ohne Gewehr
  85. PGP public key fingerprint =  8A 18 58 54 03 7B FC 12  1F 8B 63 C7 19 27 CF DA 
  86.